﻿using DevExpress.XtraGrid;
using DoAnQuamLy.DataAccess;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DoAnQuamLy.Controller
{
    class DanhMucMatHangController
    {
        DanhMucMatHangData data = new DanhMucMatHangData();
        public void SapXepDuLieuLenTreeView(TreeView trw)
        {
            DataTable LoaiHang = new DataTable();
            LoaiHang = data.layDanhSachLoaiHang();
            for (int i = 0; i < LoaiHang.Rows.Count; i++)
                trw.Nodes.Add(LoaiHang.Rows[i][1].ToString());
        }
        public void SapXepDuLieuLenDataGridView(GridControl dgv)
        {
            BindingSource bs = new BindingSource();
            bs.DataSource = data.layDanhSachLoaiHang();
            dgv.DataSource = bs;
        }
        public void Update()
        {
            data.Update();
        }
    }
}
